package router

import (
	"gateway/handler/api"
	"github.com/gin-gonic/gin"
)

func LoadRouter(r *gin.Engine) {
	v1 := r.Group("/v1")
	{
		user := v1.Group("/user")
		{
			user.POST("/sendSms", api.SendSms)   //短信发送
			user.POST("/register", api.Register) //注册
			user.POST("/login", api.Login)       //登录
		}
		cleaner := v1.Group("/cleaner")
		{
			cleaner.GET("/search", api.Search)      //搜索
			cleaner.POST("/toOrder", api.ToOrder)   //接单
			cleaner.POST("/NoOrder", api.NoOrder)   //拒单
			cleaner.POST("/mobile", api.MobileUser) //验证身份

		}
		order := v1.Group("/order")
		{
			order.POST("/create", api.OrderCreate) //预约单
			order.GET("/list", api.ListOrder)      //订单查询
		}
	}
}
